//
//  StringEncodeConvertTool.m
//  Youhuiju
//
//  Created by yutenys on 16/7/13.
//  Copyright © 2016年 yutenys. All rights reserved.
//

#import "StringEncodeConvertTool.h"

@implementation StringEncodeConvertTool
+(NSString *)convertISOString2UTF8String:(NSString *)paraStr
{
    NSData *data = [paraStr dataUsingEncoding:NSISOLatin1StringEncoding];
    
    NSStringEncoding code = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingUTF8);
    
    NSString *str = [[NSString alloc] initWithData:data encoding:code];
    return str;
}

+(NSString *)convertUTF8String2ISOString:(NSString *)paraStr
{
    NSData *data = [paraStr dataUsingEncoding:NSUTF8StringEncoding];
    
    NSStringEncoding code = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingISOLatin1);
    
    NSString *str = [[NSString alloc] initWithData:data encoding:code];
    return str;
}

@end
